package com.cy.ui;

import com.cy.factory.BeanFactory;
import com.cy.service.AccountService;
import com.cy.service.impl.AccountServiceServiceImpl;

/**
 * @Author : 残影
 * @Date: 2020-09-12 11:43
 */
public class Client {
    public static void main(String[] args) {
        //AccountService accountService = new AccountServiceServiceImpl();
        for (int i = 0; i < 5; i++) {
            AccountService accountService = (AccountService) BeanFactory.getBean("accountService");
            System.out.println(accountService);
            accountService.saveAccount();
        }
        for (int i = 0; i < 5; i++) {
            AccountService accountService = (AccountService) BeanFactory.getBeanSingleton("accountService");
            System.out.println(accountService);
            accountService.saveAccount();
        }

    }
}
